package com.org.flow.system.controller;

import com.org.flow.system.model.bo.order.GovernmentBO;
import com.org.flow.system.service.TestService;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Map;

@RestController
@Slf4j
@RequestMapping("/amber/flow/v1")
@RequiredArgsConstructor
public class TestController {

    private  final TestService testService;
    @Resource
    private FlowExecutor flowExecutor;

    /**
     * 方法描述：流程测试
     *
     * @param bo bo
     * @return {@link Object }
     * @author xú chūn chéng
     * @since 1.0.0   2024-02-26 09:47:43
     */
    @PostMapping("/test2")
    public Object test2(@RequestBody GovernmentBO bo) {
        /*
         * {
         *   "id": "",
         *   "from": "other", //模拟业务渠道入参（流程switch判断依据
         *                  // 根据渠道判断组件流程switch组件结果的下一个组件执行哪个组件）
         *    "address": "" // 测试组件before方法校验信息
         * }
         */
        return testService.test2(bo);
    }
}
